package com.ruoyi.order.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.BookReservationOrderMapper;
import com.ruoyi.order.domain.BookReservationOrder;
import com.ruoyi.order.service.IBookReservationOrderService;

/**
 * 预约借阅订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-28
 */
@Service
public class BookReservationOrderServiceImpl implements IBookReservationOrderService 
{
    @Autowired
    private BookReservationOrderMapper bookReservationOrderMapper;

    /**
     * 查询预约借阅订单
     * 
     * @param orderId 预约借阅订单主键
     * @return 预约借阅订单
     */
    @Override
    public BookReservationOrder selectBookReservationOrderByOrderId(Long orderId)
    {
        return bookReservationOrderMapper.selectBookReservationOrderByOrderId(orderId);
    }

    /**
     * 查询预约借阅订单列表
     * 
     * @param bookReservationOrder 预约借阅订单
     * @return 预约借阅订单
     */
    @Override
    public List<BookReservationOrder> selectBookReservationOrderList(BookReservationOrder bookReservationOrder)
    {
        return bookReservationOrderMapper.selectBookReservationOrderList(bookReservationOrder);
    }

    /**
     * 新增预约借阅订单
     * 
     * @param bookReservationOrder 预约借阅订单
     * @return 结果
     */
    @Override
    public int insertBookReservationOrder(BookReservationOrder bookReservationOrder)
    {
        return bookReservationOrderMapper.insertBookReservationOrder(bookReservationOrder);
    }

    /**
     * 修改预约借阅订单
     * 
     * @param bookReservationOrder 预约借阅订单
     * @return 结果
     */
    @Override
    public int updateBookReservationOrder(BookReservationOrder bookReservationOrder)
    {
        return bookReservationOrderMapper.updateBookReservationOrder(bookReservationOrder);
    }

    /**
     * 批量删除预约借阅订单
     * 
     * @param orderIds 需要删除的预约借阅订单主键
     * @return 结果
     */
    @Override
    public int deleteBookReservationOrderByOrderIds(Long[] orderIds)
    {
        return bookReservationOrderMapper.deleteBookReservationOrderByOrderIds(orderIds);
    }

    /**
     * 删除预约借阅订单信息
     * 
     * @param orderId 预约借阅订单主键
     * @return 结果
     */
    @Override
    public int deleteBookReservationOrderByOrderId(Long orderId)
    {
        return bookReservationOrderMapper.deleteBookReservationOrderByOrderId(orderId);
    }

    /**
     * 查询预约借阅订单根据bookid
     *
     * @param bookId 书籍编号
     * @return 结果
     */
    @Override
    public BookReservationOrder selectBookReservationOrderByBookId(Long bookId){
        return bookReservationOrderMapper.selectBookReservationOrderByBookId(bookId);
    }
}
